﻿using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NLog.Extensions.Logging;
using Utils.NLogHelper;
using ViewModel.WindowViewModel;

namespace ViewModel;

public static class SystemDependencyInjection
{
    public static void ConfigureServices(IServiceCollection services)
    {
        services.AddLogging(options => { options.AddNLog("Configures/NLog.config"); });
        services.Configure<AppSettings>(options =>
        {
            StartUp.Configuration?.GetSection("AppSettings")
                .Bind(options);
        });
        services.AddScoped<INlogHelper, NLogHelper>();

        services.AddSingleton<MainViewModel>();
        services.AddSingleton<LoginViewModel>();
    }
}